﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLTV_Public;
using System.Data;

namespace QLTV_Data
{
  public  class Demo_Data
    {
      KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
      public DataTable TaoBang(string sql)
      {
          return kn.taobang(sql);
      }
      public DataTable LayDuLieu()
      {
          return kn.LayDuLieu("Load_DoiTien");
      }
      public int Insert(Demo_public maLoaiTien, Demo_public menhGia, Demo_public soTo, Demo_public tongNgoaiTe, Demo_public tyGia, Demo_public tienQuyDoi)
      {
          int n = 6;
          string[] name = new string[n];
          object[] value = new object[n];
          name[0] = "@MaLoaiTien";
          value[0] = maLoaiTien.MaLoaiTien;
          name[1] = "@MenhGia";
          value[1] = menhGia.MenhGia;
          name[2] = "@SoTo";
          value[2] = soTo.SoTo;
          name[3] = "@TongNgoaiTe";
          value[3] = tongNgoaiTe.TongNgoaiTe;
          name[4] = "@TyGia";
          value[4] = tyGia.TyGia;
          name[5] = "@TienQuyDoi";
          value[5] = tienQuyDoi.TienQuyDoi;
          return kn.update("Insert_Demo",name,value,n);

      }
    }
}
